﻿using AntDesign;

namespace iOSApp.Web.CentreToolPages;

public class SignRules
{
    #region Table

    public static FormValidationRule[] UserNameRules =>
    [
        new()
            // ReSharper disable once StringLiteralTypo
            { Pattern = @"^[\u4E00-\u9FA5A-Za-z\s]+(·[\u4E00-\u9FA5A-Za-z]+)*$", Message = "姓名出错!", Required = true }
    ];

    public static FormValidationRule[] IdRules =>
    [
        new() { Len = 10, Message = "学号出错!", Pattern = "(19|20|21|22|23|24)([0-9]{8})", Required = true }
    ];

    public static FormValidationRule[] PhoneNumRules =>
    [
        new() { Len = 11, Pattern = "^1\\d{10}$", Message = "手机号不正确!", Required = true }
    ];

    public static FormValidationRule[] ClassNameRules =>
    [
        new() { Pattern = @"[\u4e00-\u9fa5|(|)|（|）]+[0-9]{4}(.*)", Message = "班级姓名出错!", Required = true }
    ];

    public static FormValidationRule[] GenderRules =>
    [
        new() { Required = true, Message = "性别没填!" }
    ];

    public static FormValidationRule[] AcademyRules =>
    [
        new() { Required = true, Message = "学院没填!" }
    ];

    public static FormValidationRule[] PoliticalLandscapeRules =>
    [
        new() { Required = true, Message = "政治面貌没填!" }
    ];

    #endregion

    #region Project

    public static FormValidationRule[] ProjectNameRules =>
    [
        new() { Len = 20, Message = "项目名称太长了", Required = true }
    ];

    public static FormValidationRule[] ProjectDescriptionRules =>
    [
        new() { Len = 512, Message = "项目描述太长了", Required = true }
    ];

    public static Dictionary<string, string> DepartmentDictionary => new()
    {
        ["All"] = "所有",
        ["Technology"] = "科技部",
        ["NewMedia"] = "新媒体部",
        ["Practical"] = "交流实践部",
        [""] = "其他",
        ["Other"] = "其他"
    };

    #endregion

    #region Resourse

    public static FormValidationRule[] ResourceNameRules =>
    [
        new() { Len = 20, Message = "项目名称太长了", Required = true }
    ];

    public static FormValidationRule[] ResourceDescriptionRules =>
    [
        new() { Len = 512, Message = "项目描述太长了", Required = true }
    ];

    #endregion

    #region Task

    public static FormValidationRule[] TaskTitleRules =>
    [
        new() { Len = 20, Message = "项目名称太长了", Required = true }
    ];

    public static FormValidationRule[] TaskDescriptionRules =>
    [
        new() { Len = 200, Message = "项目描述太长了", Required = true }
    ];

    #endregion
}